﻿@using Janus.Mes.WebClient;
@using Janus.BaseEntitys;
@using Janus.Mes.VO;
@model DefectCatHVO
@{
    Layout = null;
    int i = 0;
    int j = 0;
    int tab = 300;
    ViewBag.ViewTitle = "缺陷分类主表";
}
<style>
    .CusBaseInfo{
        width:100%;
    }
    .detail{
        float:left;
        width:100%;
    }
</style>
<div class="pageContent">
    <form method="post" action="BaseData/DefectCat/create?OpID=@ViewData["OperateID"]" class="pageForm required-validate"
          onsubmit="return validateCallback(this, dialogAjaxDone);">
        @Html.ValidationSummary(true)
        <div class="pageFormContent" layouth="56">
            <input id="hidIsCreate" name="hidIsCreate" type="hidden" value="@ViewBag.IsCreate" />
            @Html.HiddenFor(model => model.Id)
            <div class="CusBaseInfo">
                <p>
                    <label>
                        缺陷分类编号：
                    </label>

                    @if (ViewBag.IsCreate == true)
                    {
                        @Html.TextBoxFor(sysConfig => sysConfig.DefectCCode, new { @class = "required IsExisted", ajaxurl = "BaseData/DefectCat/IsExist" })
                    }
                    else
                    {
                        @Html.TextBoxFor(sysConfig => sysConfig.DefectCCode, new { @Readonly = "true" })
                    }
                    @Html.ValidationMessageFor(sysConfig => sysConfig.DefectCCode)
                </p>
                <p>
                    <label>
                        缺陷分类名称：
                    </label>
                    @Html.TextBoxFor(sysConfig => sysConfig.DefectCName, new { @class = "required" })
                    @Html.ValidationMessageFor(sysConfig => sysConfig.DefectCName)
                </p>
                <p>
                    <label>
                        启用：
                    </label>
                    @Html.CheckBoxFor(c => c.IsEnable, new { @onclick = "return false" })
                    @Html.ValidationMessageFor(c => c.IsEnable)
                </p>
                <p style="width:100%;height:50px">
                    <label>
                        备注：
                    </label>
                    @Html.TextAreaFor(sysConfig => sysConfig.Remark, new { @style = "width:65%;height:30px" })
                </p>
            </div>
            <div class="detail" id="detail0">
                <div class="MyPanel">
                    <b class="b1"></b><b class="b2 d1"></b><b class="b3 d1"></b><b class="b4 d1"></b>
                    <div class="b d1 k">
                        <div class="Title">检验特性</div>
                        <div>
                            <table class="list jItemDetails" isrownum="false" href="BaseData/DefectCat/Select" lookupgroup="FaultDescs" addButton="添加缺陷描述" pk="Code" width="100%">
                                <thead>
                                    <tr>
                                        <th type="text" name="FaultDescs[#index#].Code" size="12" fieldclass="required">缺陷描述编号</th>
                                        <th type="text" name="FaultDescs[#index#].Details" size="12" fieldclass="required">缺陷描述</th>
                                        <th type="text" name="FaultDescs[#index#].Level" size="12" fieldclass="required">缺陷等级</th>
                                        <th type="del">操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td> @Html.TextBox("Buildings[" + i + "].Code", "A1", new { @class = "required", tabindex = tab + i + j })</td>
                                        <td> @Html.TextBox("Buildings[" + i + "].Details", "音量键卡键缺陷", new { @class = "required", tabindex = tab + i + j })</td>
                                        <td> @Html.TextBox("Buildings[" + i + "].Level", "CR-严重缺陷", new { @class = "required", tabindex = tab + i + j })</td>
                                        <td><a href="javascript:void(0)" class="btnDel">删除</a></td>
                                    </tr>
                                    <tr>
                                        <td> @Html.TextBox("Buildings[" + i + "].Code", "A2", new { @class = "required", tabindex = tab + i + j })</td>
                                        <td> @Html.TextBox("Buildings[" + i + "].Details", "按键孔缺陷", new { @class = "required", tabindex = tab + i + j })</td>
                                        <td> @Html.TextBox("Buildings[" + i + "].Level", "MA-主要缺陷", new { @class = "required", tabindex = tab + i + j })</td>
                                        <td><a href="javascript:void(0)" class="btnDel">删除</a></td>
                                    </tr>
                                    <tr>
                                        <td> @Html.TextBox("Buildings[" + i + "].Code", "A3", new { @class = "required", tabindex = tab + i + j })</td>
                                        <td> @Html.TextBox("Buildings[" + i + "].Details", "导电测试缺陷", new { @class = "required", tabindex = tab + i + j })</td>
                                        <td> @Html.TextBox("Buildings[" + i + "].Level", "MI-次要缺陷", new { @class = "required", tabindex = tab + i + j })</td>
                                        <td><a href="javascript:void(0)" class="btnDel">删除</a></td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <b class="b4b d1"></b><b class="b3b d1"></b><b class="b2b d1"></b><b class="b1b"></b>
                </div>         
            </div>

            @Html.Partial("Operation", Model)
        </div>
        @Html.Partial("FormButtonBar")
    </form>
</div>
